home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks95
/
MagicTitleHack.sit
/
MagicTitle
/
MagicTitle Source&Stuff
/
Source
/
FileSystemStuff.c
next >
Wrap
Text File
|
1995-06-22
|
747b
|
34 lines
// FileSystemStuff.c
#include "FileSystemStuff.h"
#include <Errors.h>
OSErr GetParent(const FSSpec *item, FSSpec *parent)
{
CInfoPBRec pb;
OSErr err = noErr;
pb.hFileInfo.ioCompletion = 0;
pb.hFileInfo.ioNamePtr = parent->name;
pb.hFileInfo.ioFDirIndex = -1;
pb.hFileInfo.ioVRefNum = item->vRefNum;
pb.hFileInfo.ioDirID = item->parID;
err = PBGetCatInfoSync(&pb);
if(err == noErr)
err = FSMakeFSSpec (item->vRefNum, pb.hFileInfo.ioFlParID, parent->name, parent);
return err;
}
OSErr MyFSMakeFSSpec(short volume, long directory, ConstStr255Param name, FSSpec *spec)
{
if(name[0] > 31)
return fnfErr;
spec->parID = directory;
spec->vRefNum = volume;
BlockMoveData(name, spec->name, name[0] + 1);
return noErr;
}